<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Yamii.fi',
	'theme'=>'venera',

	'preload' => array(
		'log',	// preloading 'log' component
		'bootstrap', // preload the bootstrap component
	),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
	),

	'modules'=>array(
		'api', 'apidev',
		'mobile',
		// uncomment the following to enable the Gii tool
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'_admin_',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
			// use bootstrap extension
			'generatorPaths' => array(
				'bootstrap.gii', // since 0.9.1
			),
		),
	),

	// application components
	'components'=>array(
		'user'=>array(
			//set default login url
			'loginUrl' => array('accounts/login'),
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
		'urlManager'=>array(
			'showScriptName' => false,
			'urlFormat'=>'path',
			'rules'=>array(
				'place/v/<id:[a-zA-Z0-9-]+>/'=>'place/view',//SEO merchant URL
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		'db' => array(
			'connectionString' => 'mysql:host=localhost;dbname=yamiifi_prod1',
			'emulatePrepare' => true,
			'username' => 'yamiifi_prod1',
			'password' => 'yamii_prod1',
			'charset' => 'utf8',
			'enableProfiling' => true,	// enable profiling
			'enableParamLogging' => true,	// enable logging
			//'initSQLs'=>array("set time_zone='+03:00';"),//dont use this static timezone
		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'format'=>array(
			'class'=>'application.extensions.timeago.TimeagoFormatter',
		),
		'bootstrap' => array(
			'class' => 'ext.bootstrap.components.Bootstrap', // assuming you extracted bootstrap under extensions
		),
		'cache' => array(
            'class' => 'system.caching.CFileCache',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				/*
				array(
                    'class' => 'application.extensions.pqp.PQPLogRoute',
                    'categories' => 'application.*, exception.*, system.*',
                ),*/
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),
	
	'defaultController' => 'app',
	'language' => 'fi_fi',

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		'siteRoot'=>'http://yamii.fi',
		'adminEmail'=>'admin@yamii.fi',
		'pageSize' => 20,
		'version' => 2.1,
		'facebook' => array(
			'appId'  => '422576134463730',
			'secret' => '58aa558cf80ddaad60c732114eeba116',
		),
		'facebookPageUrl' => 'http://on.fb.me/16bgrtJ', //http://facebook.com/yamiideal
		'db_performance' => true,
	),
);